package smartcrud.spring.models.cms;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import smartcrud.common.orm.Page;
import smartcrud.common.orm.PropertyFilter;

@Service
public class CategoryServiceJdbcImpl implements CategoryService {
	@Autowired
	private CategoryDao categoryDao;

	@Override
	public Category createCategory(Category o) {
		return categoryDao.createCategory(o);
	}

	@Override
	public void deleteCategory(Long id) {
		categoryDao.deleteCategory(id);
	}

	@Override
	public void updateCategory(Category o) {
		categoryDao.updateCategory(o);
	}

	@Override
	public Category findCategoryById(Long id) {
		return categoryDao.findCategoryById(id);
	}

	@Override
	public List<Category> findAllCategorys() {
		return categoryDao.findAllCategorys();
	}
	
    @Override
    public int count() {
        return categoryDao.count();
    }	

	@Override
	public Page<Category> findByPage(Page<Category> page, final List<PropertyFilter> filters) {
		return categoryDao.findByPage(page,filters);
	}
}
